package com.eqdd.yiqidian.ui.mine.setting;

import android.databinding.DataBindingUtil;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;

import com.eqdd.yiqidian.ContactActivityCustom;
import com.eqdd.yiqidian.R;
import com.eqdd.yiqidian.adapter.slimadapter.SlimAdapterEx;
import com.eqdd.yiqidian.adapter.slimadapter.SlimInjector;
import com.eqdd.yiqidian.adapter.slimadapter.viewinjector.IViewInjector;
import com.eqdd.yiqidian.base.BaseActivity;
import com.eqdd.yiqidian.bean.SecondBean;

import java.util.ArrayList;

public class ContactActivity extends BaseActivity {
    private ContactActivityCustom dataBinding;
    private ArrayList<SecondBean> secondBeen;

    @Override
    public void initBinding() {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_contact);
        initTopTitleBar(View.VISIBLE, "联系易企点");
    }

    @Override
    public void initData() {
        secondBeen = new ArrayList<>();
        secondBeen.add(new SecondBean("qq号：", "727024586"));
        secondBeen.add(new SecondBean("微信号：", "rushi0925"));
        secondBeen.add(new SecondBean("邮箱：", "18545548@eqdd.com"));
        secondBeen.add(new SecondBean("统一客服电话：", "133-0381-1389"));
    }

    @Override
    public void setView() {

        dataBinding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
        SlimAdapterEx slimAdapterEx = SlimAdapterEx.create().register(R.layout.list_item_08, new SlimInjector<SecondBean>() {
            @Override
            public void onInject(SecondBean data, IViewInjector injector) {
                injector.text(R.id.tv_upper_content, data.getFirst())
                        .text(R.id.tv_down_content, data.getSecond())
                        .invisible(R.id.iv_right_enter);
            }
        }).attachTo(dataBinding.recyclerView);
        slimAdapterEx.updateData(secondBeen);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {

        }
    }
}
